import { defineStore } from 'pinia';
import instance from '@/utils/request';
import type { CategoryList } from './home.d';
export const useHomeStore = defineStore('home', {
  state: () => ({
    categoryList: [] as CategoryList,
  }),
  actions: {
    // 获取导航列表
    async getAllCategory() {
      const res = await instance.get('/home/category/head');
      this.categoryList = res.data.result;
    },
  },
});
